import java.util.*;
public class TestStudent {

	public static void main(String[] args) {
	try {
		Scanner input = new Scanner(System.in);
		String name;
		int num;
		System.out.println("Enter the student name: ");
		name = input.nextLine();
		Student student1 = new Student(name);
		System.out.println("Enter the number of Quizzes taken: ");
		num = input.nextInt();
		double score = 0;
		for (int i = 1; i <= num; i++) {
			System.out.printf("Enter grade of Quiz#%d for %s : " , i , name);
			score = input.nextDouble();
			student1.addQuiz(score);
		} 
			System.out.printf("Name: %s , Quiz average: %.2f ", name , student1.getAverage());
			input.close();
	}
		catch (InputMismatchException e) {
			System.out.println("Error : " + e);
			
		}
		catch (IllegalArgumentException I) {
			System.out.println(I + " : score is negative");
		}
		catch (UnsupportedOperationException U) {
			System.out.println(U + " : Number of Quizzes is zero");
			
		}
		
		}
	
		

	}